package calcutil

const (
	T1  int64 = 10
	T2  int64 = 1e2
	T3  int64 = 1e3
	T4  int64 = 1e4
	T5  int64 = 1e5
	T6  int64 = 1e6
	T7  int64 = 1e7
	T8  int64 = 1e8
	T9  int64 = 1e9
	T10 int64 = 1e10
	T11 int64 = 1e11
	T12 int64 = 1e12
	T13 int64 = 1e13
	T14 int64 = 1e14
	T15 int64 = 1e15
	T16 int64 = 1e16
	T17 int64 = 1e17
	T18 int64 = 1e18
)

func GetPrecisionFactor(precision int32) int64 {
	switch precision {
	case 1:
		return T1
	case 2:
		return T2
	case 3:
		return T3
	case 4:
		return T4
	case 5:
		return T5
	case 6:
		return T6
	case 7:
		return T7
	case 8:
		return T8
	case 9:
		return T9
	case 10:
		return T10
	case 11:
		return T11
	case 12:
		return T12
	case 13:
		return T13
	case 14:
		return T14
	case 15:
		return T15
	case 16:
		return T16
	case 17:
		return T17
	case 18:
		return T18
	}

	return 1
}
